﻿#version 130

uniform mat4 matrix_projection;
uniform mat4 matrix_view;
uniform mat4 matrix_world;

uniform mat4 matrix_shadow0;
uniform mat4 matrix_shadow1;
uniform mat4 matrix_shadow2;


in vec4 vertices;


out vec4 shadow_map_coord [3];

void main(void)
{
    // calculate the shadow map
    vec4 global_pos = matrix_world * vertices;
    shadow_map_coord[0] = matrix_shadow0 * global_pos;
    shadow_map_coord[1] = matrix_shadow1 * global_pos;
    shadow_map_coord[2] = matrix_shadow2 * global_pos;


    gl_Position = matrix_projection * matrix_view * matrix_world * vertices;
}
